//条形进度条
(function ($) {
    'use strict';
    $.fn.LineProgressbar = function (options) {
        var options = $.extend({
            percentage: null,
            ShowProgressCount: true,
            duration: 1000,
            // Styling Options
            fillBackgroundColor: '#797878',
            backgroundColor: '#fff',
            radius: '0px',
            height: '15px',
            width: '180px'
        }, options);

        return this.each(function (index, el) {
            // Markup
            $(el).html('<div class="percentCount"></div><div class="progressbar"><div class="proggress"></div></div>');
            var progressFill = $(el).find('.proggress');
            var progressBar = $(el).find('.progressbar');
            progressFill.css({
                backgroundColor: options.fillBackgroundColor,
                height: options.height,
                borderRadius: options.radius
            });
            progressBar.css({
                width: options.width,
                backgroundColor: options.backgroundColor,
                borderRadius: options.radius
            });
            // Progressing
            progressFill.animate(
                {
                    width: options.percentage + "%"
                },
                {
                    step: function (x) {
                        if (options.ShowProgressCount) {
                            $(el).find(".percentCount").text(Math.round(x) + "℃");
                        }
                    },
                    duration: options.duration
                }
            );
        });
    }
})(jQuery);
//绘制平仓模型
var dataArray = [

[[[21.4,2],[23.6,2],[23.8,2],[20.2,2],[20.2,2],[23.4,2],[23.2,2],[17.6,2],[20.2,2],[23.2,2],[16.3,2],[23.4,2],[22.8,2],[23,2],[23.5,2],[22.8,2]],[[22.9,2],[22.8,2],[25,2],[23.5,2],[23.4,2],[23.3,2],[23.1,2],[22.5,2],[23.1,2],[23.4,2],[23.2,2],[22.6,2],[22.8,2],[23,2],[23.3,2],[22.9,2]],[[22.3,2],[23.7,2],[23.5,2],[23.3,2],[18.9,2],[23.5,2],[23.2,2],[22.8,2],[23.2,2],[23.3,2],[23.5,2],[23.4,2],[22.7,2],[23.4,2],[22.6,2],[22.2,2]],[[22.3,2],[22,2],[23.7,2],[21.3,2],[20,2],[23.9,2],[23.3,2],[22.1,2],[23.5,2],[23.3,2],[23.5,2],[22.7,2],[22.8,2],[23.1,2],[22.6,2],[21.9,2]],[[20.8,2],[23.2,2],[22.3,2],[21.1,2],[23.2,2],[23.6,2],[22.2,2],[23.5,2],[23.7,2],[23.1,2],[23.4,2],[23.2,2],[23.2,2],[23.4,2],[23,2],[22.8,2]],[[22.5,2],[23.3,2],[21.9,2],[21.4,2],[23.5,2],[23.6,2],[23.6,2],[23.4,2],[23.1,2],[23.4,2],[23.4,2],[23.5,2],[23,2],[23,2],[22.9,2],[23.1,2]],[[19.4,2],[22,2],[22.1,2],[21.4,2],[23.8,2],[23,2],[23.4,2],[19.8,2],[22.9,2],[23.9,2],[24.1,2],[22.6,2],[23.4,2],[23.7,2],[22.9,2],[22.8,2]],[[21.4,2],[23.6,2],[23.8,2],[20.2,2],[20.2,2],[23.4,2],[23.2,2],[17.6,2],[20.2,2],[23.2,2],[16.3,2],[23.4,2],[22.8,2],[23,2],[23.5,2],[22.8,2]],[[22.9,2],[22.8,2],[25,2],[23.5,2],[23.4,2],[23.3,2],[23.1,2],[22.5,2],[23.1,2],[23.4,2],[23.2,2],[22.6,2],[22.8,2],[23,2],[23.3,2],[22.9,2]],[[22.3,2],[23.7,2],[23.5,2],[23.3,2],[18.9,2],[23.5,2],[23.2,2],[22.8,2],[23.2,2],[23.3,2],[23.5,2],[23.4,2],[22.7,2],[23.4,2],[22.6,2],[22.2,2]],[[22.3,2],[22,2],[23.7,2],[21.3,2],[20,2],[23.9,2],[23.3,2],[22.1,2],[23.5,2],[23.3,2],[23.5,2],[22.7,2],[22.8,2],[23.1,2],[22.6,2],[21.9,2]],[[20.8,2],[23.2,2],[22.3,2],[21.1,2],[23.2,2],[23.6,2],[22.2,2],[23.5,2],[23.7,2],[23.1,2],[23.4,2],[23.2,2],[23.2,2],[23.4,2],[23,2],[22.8,2]],[[22.5,2],[23.3,2],[21.9,2],[21.4,2],[23.5,2],[23.6,2],[23.6,2],[23.4,2],[23.1,2],[23.4,2],[23.4,2],[23.5,2],[23,2],[23,2],[22.9,2],[23.1,2]],[[19.4,2],[22,2],[22.1,2],[21.4,2],[23.8,2],[23,2],[23.4,2],[19.8,2],[22.9,2],[23.9,2],[24.1,2],[22.6,2],[23.4,2],[23.7,2],[22.9,2],[22.8,2]]],

[[[21.4,2],[23.6,2],[23.8,2],[20.2,2],[20.2,2],[23.4,2],[23.2,2],[17.6,2],[20.2,2],[23.2,2],[16.3,2],[23.4,2],[22.8,2],[23,2],[23.5,2],[22.8,2]],[[22.9,2],[22.8,2],[25,2],[23.5,2],[23.4,2],[23.3,2],[23.1,2],[22.5,2],[23.1,2],[23.4,2],[23.2,2],[22.6,2],[22.8,2],[23,2],[23.3,2],[22.9,2]],[[22.3,2],[23.7,2],[23.5,2],[23.3,2],[18.9,2],[23.5,2],[23.2,2],[22.8,2],[23.2,2],[23.3,2],[23.5,2],[23.4,2],[22.7,2],[23.4,2],[22.6,2],[22.2,2]],[[22.3,2],[22,2],[23.7,2],[21.3,2],[20,2],[23.9,2],[23.3,2],[22.1,2],[23.5,2],[23.3,2],[23.5,2],[22.7,2],[22.8,2],[23.1,2],[22.6,2],[21.9,2]],[[20.8,2],[23.2,2],[22.3,2],[21.1,2],[23.2,2],[23.6,2],[22.2,2],[23.5,2],[23.7,2],[23.1,2],[23.4,2],[23.2,2],[23.2,2],[23.4,2],[23,2],[22.8,2]],[[22.5,2],[23.3,2],[21.9,2],[21.4,2],[23.5,2],[23.6,2],[23.6,2],[23.4,2],[23.1,2],[23.4,2],[23.4,2],[23.5,2],[23,2],[23,2],[22.9,2],[23.1,2]],[[19.4,2],[22,2],[22.1,2],[21.4,2],[23.8,2],[23,2],[23.4,2],[19.8,2],[22.9,2],[23.9,2],[24.1,2],[22.6,2],[23.4,2],[23.7,2],[22.9,2],[22.8,2]],[[21.4,2],[23.6,2],[23.8,2],[20.2,2],[20.2,2],[23.4,2],[23.2,2],[17.6,2],[20.2,2],[23.2,2],[16.3,2],[23.4,2],[22.8,2],[23,2],[23.5,2],[22.8,2]],[[22.9,2],[22.8,2],[25,2],[23.5,2],[23.4,2],[23.3,2],[23.1,2],[22.5,2],[23.1,2],[23.4,2],[23.2,2],[22.6,2],[22.8,2],[23,2],[23.3,2],[22.9,2]],[[22.3,2],[23.7,2],[23.5,2],[23.3,2],[18.9,2],[23.5,2],[23.2,2],[22.8,2],[23.2,2],[23.3,2],[23.5,2],[23.4,2],[22.7,2],[23.4,2],[22.6,2],[22.2,2]],[[22.3,2],[22,2],[23.7,2],[21.3,2],[20,2],[23.9,2],[23.3,2],[22.1,2],[23.5,2],[23.3,2],[23.5,2],[22.7,2],[22.8,2],[23.1,2],[22.6,2],[21.9,2]],[[20.8,2],[23.2,2],[22.3,2],[21.1,2],[23.2,2],[23.6,2],[22.2,2],[23.5,2],[23.7,2],[23.1,2],[23.4,2],[23.2,2],[23.2,2],[23.4,2],[23,2],[22.8,2]],[[22.5,2],[23.3,2],[21.9,2],[21.4,2],[23.5,2],[23.6,2],[23.6,2],[23.4,2],[23.1,2],[23.4,2],[23.4,2],[23.5,2],[23,2],[23,2],[22.9,2],[23.1,2]],[[19.4,2],[22,2],[22.1,2],[21.4,2],[23.8,2],[23,2],[23.4,2],[19.8,2],[22.9,2],[23.9,2],[24.1,2],[22.6,2],[23.4,2],[23.7,2],[22.9,2],[22.8,2]]],

[[[21.4,2],[23.6,2],[23.8,2],[20.2,2],[20.2,2],[23.4,2],[23.2,2],[17.6,2],[20.2,2],[23.2,2],[16.3,2],[23.4,2],[22.8,2],[23,2],[23.5,2],[22.8,2]],[[22.9,2],[22.8,2],[25,2],[23.5,2],[23.4,2],[23.3,2],[23.1,2],[22.5,2],[23.1,2],[23.4,2],[23.2,2],[22.6,2],[22.8,2],[23,2],[23.3,2],[22.9,2]],[[22.3,2],[23.7,2],[23.5,2],[23.3,2],[18.9,2],[23.5,2],[23.2,2],[22.8,2],[23.2,2],[23.3,2],[23.5,2],[23.4,2],[22.7,2],[23.4,2],[22.6,2],[22.2,2]],[[22.3,2],[22,2],[23.7,2],[21.3,2],[20,2],[23.9,2],[23.3,2],[22.1,2],[23.5,2],[23.3,2],[23.5,2],[22.7,2],[22.8,2],[23.1,2],[22.6,2],[21.9,2]],[[20.8,2],[23.2,2],[22.3,2],[21.1,2],[23.2,2],[23.6,2],[22.2,2],[23.5,2],[23.7,2],[23.1,2],[23.4,2],[23.2,2],[23.2,2],[23.4,2],[23,2],[22.8,2]],[[22.5,2],[23.3,2],[21.9,2],[21.4,2],[23.5,2],[23.6,2],[23.6,2],[23.4,2],[23.1,2],[23.4,2],[23.4,2],[23.5,2],[23,2],[23,2],[22.9,2],[23.1,2]],[[19.4,2],[22,2],[22.1,2],[21.4,2],[23.8,2],[23,2],[23.4,2],[19.8,2],[22.9,2],[23.9,2],[24.1,2],[22.6,2],[23.4,2],[23.7,2],[22.9,2],[22.8,2]],[[21.4,2],[23.6,2],[23.8,2],[20.2,2],[20.2,2],[23.4,2],[23.2,2],[17.6,2],[20.2,2],[23.2,2],[16.3,2],[23.4,2],[22.8,2],[23,2],[23.5,2],[22.8,2]],[[22.9,2],[22.8,2],[25,2],[23.5,2],[23.4,2],[23.3,2],[23.1,2],[22.5,2],[23.1,2],[23.4,2],[23.2,2],[22.6,2],[22.8,2],[23,2],[23.3,2],[22.9,2]],[[22.3,2],[23.7,2],[23.5,2],[23.3,2],[18.9,2],[23.5,2],[23.2,2],[22.8,2],[23.2,2],[23.3,2],[23.5,2],[23.4,2],[22.7,2],[23.4,2],[22.6,2],[22.2,2]],[[22.3,2],[22,2],[23.7,2],[21.3,2],[20,2],[23.9,2],[23.3,2],[22.1,2],[23.5,2],[23.3,2],[23.5,2],[22.7,2],[22.8,2],[23.1,2],[22.6,2],[21.9,2]],[[20.8,2],[23.2,2],[22.3,2],[21.1,2],[23.2,2],[23.6,2],[22.2,2],[23.5,2],[23.7,2],[23.1,2],[23.4,2],[23.2,2],[23.2,2],[23.4,2],[23,2],[22.8,2]],[[22.5,2],[23.3,2],[21.9,2],[21.4,2],[23.5,2],[23.6,2],[23.6,2],[23.4,2],[23.1,2],[23.4,2],[23.4,2],[23.5,2],[23,2],[23,2],[22.9,2],[23.1,2]],[[19.4,2],[22,2],[22.1,2],[21.4,2],[23.8,2],[23,2],[23.4,2],[19.8,2],[22.9,2],[23.9,2],[24.1,2],[22.6,2],[23.4,2],[23.7,2],[22.9,2],[22.8,2]]],

[[[13.7,2],[11.8,2],[10.9,2],[10.5,2],[11.3,2],[11.2,2],[11.9,2],[12,2],[10.1,2],[18.8,2],[10.3,2],[12,2],[12.2,2],[10.8,2],[15.4,2],[12.4,2]],[[10.3,2],[9.9,2],[10,2],[10,2],[11.1,2],[10.6,2],[16.1,2],[9.4,2],[18.4,2],[16.7,2],[10.2,2],[10.9,2],[10.9,2],[15,2],[10.8,2],[10.5,2]],[[11.9,2],[11.2,2],[10.1,2],[10.4,2],[11.4,2],[11.2,2],[10.6,2],[9.5,2],[16.4,2],[19.4,2],[16.3,2],[12.2,2],[13.2,2],[10.2,2],[9,2],[21.9,2]],[[11.1,2],[9.8,2],[9.9,2],[9.7,2],[11.4,2],[10,2],[10.1,2],[9.2,2],[16.3,2],[16.1,2],[15.5,2],[13.3,2],[22.8,2],[10.2,2],[11.3,2],[11,2]],[[10.8,2],[8.8,2],[8.4,2],[8.3,2],[9.8,2],[10,2],[8.4,2],[9.7,2],[16.8,2],[17.3,2],[14.6,2],[8.6,2],[10.3,2],[9.7,2],[8.7,2],[10.9,2]],[[12.1,2],[9,2],[8.7,2],[8.3,2],[9.7,2],[9.8,2],[9.9,2],[9.3,2],[16.1,2],[15.1,2],[16.1,2],[8.5,2],[9.9,2],[9.7,2],[8.8,2],[12.4,2]],[[14.1,2],[10.9,2],[11.3,2],[10.1,2],[11.8,2],[12.9,2],[10,2],[10.5,2],[13.1,2],[16,2],[15.4,2],[12.7,2],[14.6,2],[11,2],[11.1,2],[11,2]],[[13.7,2],[11.8,2],[10.9,2],[10.5,2],[11.3,2],[11.2,2],[11.9,2],[12,2],[10.1,2],[18.8,2],[10.3,2],[12,2],[12.2,2],[10.8,2],[15.4,2],[12.4,2]],[[10.3,2],[9.9,2],[10,2],[10,2],[11.1,2],[10.6,2],[16.1,2],[9.4,2],[18.4,2],[16.7,2],[10.2,2],[10.9,2],[10.9,2],[15,2],[10.8,2],[10.5,2]],[[11.9,2],[11.2,2],[10.1,2],[10.4,2],[11.4,2],[11.2,2],[10.6,2],[9.5,2],[16.4,2],[19.4,2],[16.3,2],[12.2,2],[13.2,2],[10.2,2],[9,2],[21.9,2]],[[11.1,2],[9.8,2],[9.9,2],[9.7,2],[11.4,2],[10,2],[10.1,2],[9.2,2],[16.3,2],[16.1,2],[15.5,2],[13.3,2],[22.8,2],[10.2,2],[11.3,2],[11,2]],[[10.8,2],[8.8,2],[8.4,2],[8.3,2],[9.8,2],[10,2],[8.4,2],[9.7,2],[16.8,2],[17.3,2],[14.6,2],[8.6,2],[10.3,2],[9.7,2],[8.7,2],[10.9,2]],[[12.1,2],[9,2],[8.7,2],[8.3,2],[9.7,2],[9.8,2],[9.9,2],[9.3,2],[16.1,2],[15.1,2],[16.1,2],[8.5,2],[9.9,2],[9.7,2],[8.8,2],[12.4,2]],[[14.1,2],[10.9,2],[11.3,2],[10.1,2],[11.8,2],[12.9,2],[10,2],[10.5,2],[13.1,2],[16,2],[15.4,2],[12.7,2],[14.6,2],[11,2],[11.1,2],[11,2]]],

[[[13.2,2],[9.5,2],[8.1,2],[9.2,2],[11.3,2],[10.3,2],[11.4,2],[12.4,2],[9.8,2],[13.3,2],[9.8,2],[10.7,2],[10.6,2],[9,2],[8.8,2],[11,2]],[[8.5,2],[9.9,2],[9.3,2],[8.5,2],[11.2,2],[9.6,2],[8.7,2],[9.1,2],[9.5,2],[8.2,2],[7.2,2],[8.6,2],[8.1,2],[8.2,2],[7,2],[9.6,2]],[[10.4,2],[9.8,2],[9.7,2],[1005,3],[13,2],[10.3,2],[8.4,2],[9.1,2],[9.2,2],[8.8,2],[8,2],[11.7,2],[7.6,2],[9.3,2],[6.6,2],[7.5,2]],[[10.1,2],[10.7,2],[10.3,2],[9.7,2],[14,2],[8.6,2],[8.1,2],[9.4,2],[9.2,2],[9.3,2],[6.9,2],[13.2,2],[10.9,2],[9.4,2],[7.5,2],[10.7,2]],[[9.1,2],[8.5,2],[8.5,2],[7.8,2],[8.8,2],[8.1,2],[7.7,2],[8.7,2],[8.4,2],[7.6,2],[6.8,2],[7.6,2],[8.7,2],[8.7,2],[7.1,2],[7.4,2]],[[11,2],[8.2,2],[9,2],[7.5,2],[8.4,2],[8.2,2],[7.1,2],[8.3,2],[7.6,2],[7.6,2],[7.6,2],[8.4,2],[8.6,2],[8.9,2],[7.4,2],[10.2,2]],[[14.7,2],[9.6,2],[9.4,2],[8,2],[7.7,2],[11.1,2],[7,2],[9.3,2],[9.8,2],[11,2],[11.8,2],[13.6,2],[15.9,2],[7.4,2],[7.4,2],[8.4,2]],[[13.2,2],[9.5,2],[8.1,2],[9.2,2],[11.3,2],[10.3,2],[11.4,2],[12.4,2],[9.8,2],[13.3,2],[9.8,2],[10.7,2],[10.6,2],[9,2],[8.8,2],[11,2]],[[8.5,2],[9.9,2],[9.3,2],[8.5,2],[11.2,2],[9.6,2],[8.7,2],[9.1,2],[9.5,2],[8.2,2],[7.2,2],[8.6,2],[8.1,2],[8.2,2],[7,2],[9.6,2]],[[10.4,2],[9.8,2],[9.7,2],[1005,3],[13,2],[10.3,2],[8.4,2],[9.1,2],[9.2,2],[8.8,2],[8,2],[11.7,2],[7.6,2],[9.3,2],[6.6,2],[7.5,2]],[[10.1,2],[10.7,2],[10.3,2],[9.7,2],[14,2],[8.6,2],[8.1,2],[9.4,2],[9.2,2],[9.3,2],[6.9,2],[13.2,2],[10.9,2],[9.4,2],[7.5,2],[10.7,2]],[[9.1,2],[8.5,2],[8.5,2],[7.8,2],[8.8,2],[8.1,2],[7.7,2],[8.7,2],[8.4,2],[7.6,2],[6.8,2],[7.6,2],[8.7,2],[8.7,2],[7.1,2],[7.4,2]],[[11,2],[8.2,2],[9,2],[7.5,2],[8.4,2],[8.2,2],[7.1,2],[8.3,2],[7.6,2],[7.6,2],[7.6,2],[8.4,2],[8.6,2],[8.9,2],[7.4,2],[10.2,2]],[[14.7,2],[9.6,2],[9.4,2],[8,2],[7.7,2],[11.1,2],[7,2],[9.3,2],[9.8,2],[11,2],[11.8,2],[13.6,2],[15.9,2],[7.4,2],[7.4,2],[8.4,2]]],

[[[-100,2],[12.6,2],[11.4,2],[13.2,2],[15.1,2],[13.1,2],[14.6,2],[15.6,2],[13.8,2],[12.7,2],[13.3,2],[1005,3],[11.8,2],[11.3,2],[7.8,2],[14.3,2]],[[14.4,2],[15.1,2],[14.2,2],[13.7,2],[16.2,2],[12.5,2],[8.5,2],[12.7,2],[10,2],[9.3,2],[9.6,2],[12.1,2],[11.2,2],[10.2,2],[7.6,2],[14.1,2]],[[15,2],[12.6,2],[14.5,2],[14,2],[18.1,2],[12.8,2],[10.9,2],[13.1,2],[9.8,2],[8.7,2],[8.4,2],[17.5,2],[9,2],[14.3,2],[9.4,2],[10.4,2]],[[14.9,2],[16.1,2],[15.7,2],[15,2],[19.1,2],[10.8,2],[10.2,2],[14.5,2],[9.8,2],[11.2,2],[6.8,2],[16.2,2],[7.6,2],[11.7,2],[9,2],[15.6,2]],[[13.6,2],[14.1,2],[14.3,2],[13.5,2],[11.9,2],[11,2],[12.6,2],[12.1,2],[9.8,2],[7.9,2],[6.9,2],[14.6,2],[13.2,2],[14,2],[10.5,2],[9.2,2]],[[15.2,2],[13.1,2],[15.4,2],[12.6,2],[12.2,2],[11.1,2],[9.3,2],[13,2],[8.9,2],[8.5,2],[6.7,2],[12.6,2],[13.4,2],[14.1,2],[12.8,2],[12.8,2]],[[16.7,2],[14.2,2],[13.8,2],[13.2,2],[8.5,2],[12.1,2],[7.8,2],[13.1,2],[10.9,2],[10.1,2],[11.6,2],[19.9,2],[21.8,2],[10.7,2],[9.5,2],[10.9,2]],[[16,2],[12.6,2],[11.4,2],[13.2,2],[15.1,2],[13.1,2],[14.6,2],[15.6,2],[13.8,2],[12.7,2],[13.3,2],[1005,3],[11.8,2],[11.3,2],[7.8,2],[14.3,2]],[[14.4,2],[15.1,2],[14.2,2],[13.7,2],[16.2,2],[12.5,2],[8.5,2],[12.7,2],[10,2],[9.3,2],[9.6,2],[12.1,2],[11.2,2],[10.2,2],[7.6,2],[14.1,2]],[[15,2],[12.6,2],[14.5,2],[14,2],[18.1,2],[12.8,2],[10.9,2],[13.1,2],[9.8,2],[8.7,2],[8.4,2],[17.5,2],[9,2],[14.3,2],[9.4,2],[10.4,2]],[[14.9,2],[16.1,2],[15.7,2],[15,2],[19.1,2],[10.8,2],[10.2,2],[14.5,2],[9.8,2],[11.2,2],[6.8,2],[16.2,2],[7.6,2],[11.7,2],[9,2],[15.6,2]],[[13.6,2],[14.1,2],[14.3,2],[13.5,2],[11.9,2],[11,2],[12.6,2],[12.1,2],[9.8,2],[7.9,2],[6.9,2],[14.6,2],[13.2,2],[14,2],[10.5,2],[9.2,2]],[[15.2,2],[13.1,2],[15.4,2],[12.6,2],[12.2,2],[11.1,2],[9.3,2],[13,2],[8.9,2],[8.5,2],[6.7,2],[12.6,2],[13.4,2],[14.1,2],[12.8,2],[12.8,2]],[[16.7,2],[14.2,2],[13.8,2],[13.2,2],[8.5,2],[12.1,2],[7.8,2],[13.1,2],[10.9,2],[10.1,2],[11.6,2],[19.9,2],[21.8,2],[10.7,2],[9.5,2],[10.9,2]]]
]; 
/**
*	@author wkm
*	@description 绘制仓库的主体部分;
*	@date 20170611
*/
function drawMain(){
	var paper = null;//定义画板
	var li = [dataArray[0][0].length, dataArray[0].length]; //列数，行数
	var paperWidth =46 * li[0];//宽度 736px
	var n = dataArray.length; //层数 6层
	var paperHeight =  n * 40;//高度
	var paperAngle = 70;//角度
	var paperDepth = paperHeight / n+140; //180景深
	var outerKagehiro = paperDepth/(Math.tan(Math.PI * paperAngle * 2 /360 ));//外景宽
	var innerKagehiro = paperWidth - 2 * outerKagehiro; //内景宽
	var origin = [40,0];//定义原点
	var option = {
		paperWidth:paperWidth,
		paperHeight:paperHeight,
		paperAngle:paperAngle,
		paperDepth:paperDepth,
		outerKagehiro:outerKagehiro,
		innerKagehiro:innerKagehiro,
		origin:origin
		};//参数用于传递给其他函数方法
	paper = Raphael("drawContent", 800, 500);//初始化画板
	var bgSetting = paper.set();//绘制背景
	bgSetting.push(
		paper.rect(origin[0] + outerKagehiro, origin[1], innerKagehiro, paperHeight), //正背景
		paper.path("M" + (origin[0] + outerKagehiro) + " " + origin[1] + "L" + origin[0]+ " " + (origin[1] + paperDepth) + "V" + (origin[1] + paperDepth + paperHeight) + "L" + (origin[0] + outerKagehiro) + " " + (origin[1] + paperHeight) + ""), //左背景
		paper.path("M" + (origin[0] + outerKagehiro + innerKagehiro) + " " + origin[1] + "L" + (origin[0] + paperWidth) + " " + (origin[1] + paperDepth) + "V" + (origin[1] + paperDepth + paperHeight) + "L" + (origin[0] + outerKagehiro + innerKagehiro) + " " + (origin[1] + paperHeight) + ""),//右背景
		paper.path('M' + (origin[0] + outerKagehiro) + ' '+ paperHeight + ' L' + (origin[0] + outerKagehiro + innerKagehiro) + " " + paperHeight + 'L' + (origin[0] + paperWidth ) + ' ' + (paperHeight + paperDepth) + 'L' + origin[0] + ' ' + (paperDepth+paperHeight) + ' ' + 'L' + (origin[0] + outerKagehiro) + ' ' + paperHeight)//底背景
	).attr({ "fill": "90-#fff-#000", "fill-opacity": "0.1" ,"stroke-width":"1","stroke-opacity":'0.7'});//背景属性,填充渐变，0.1透明
	layerClick(paper,6,option);//左侧层显示
	drawDynamic(paper,dataArray[0],1,option);//页面初始化的时候显示第一层数据
}

function drawDynamic(paper,data,index,opts){
	var yIncrement = 40;//y轴的增量，用于层，线条和数据
	if(opts.setting){
		opts.setting.remove();
	}  
	var _x = yIncrement + opts.outerKagehiro;
	var _y = 0;
	var yy = yIncrement;
	var t = index;
	var mw = opts.innerKagehiro;//内景宽
	var lh = opts.paperDepth;//景深
	var l = opts.origin;
	var width = opts.paperWidth;
	var lw = opts.outerKagehiro;//外景宽
	var setting = paper.set();
	//var li = [16,14];
	var li = [dataArray[0][0].length, dataArray[0].length]; //列数，行数
	var n = dataArray.length; //层数
	setting.push(paper.path([["M", _x, _y+yy*t], ["L", (_x + mw),yy*t], ["L", l[0] + width, yy*t + lh], ["L", l[0], yy*t + lh], ["L", _x, yy*t]])).attr({ "fill": "#F7E39A", "fill-opacity": "0.3", "cursor": "pointer" }).mouseout(function(event) {
            this.animate({ "fill-opacity": "0.3" }, 1000);  //鼠标移出事件
        }).mouseover(function(event) {
            this.animate({"fill-opacity": "0.7" }, 1000); //鼠标移入事件  'fill':"#BCE3F5",
        }); 
	
    for (var c = 0; c <= li[0]; c++) {//竖线 l[0]=40px 1w=69.15434451057847  li[0]=16px;内宽度mw=597.691310978843 lh=190px
        setting.push(paper.path([["M", (_x+ mw / li[0] * c), (_y+yy*t)], ["L", (l[0] + width / li[0] * c), yy * t + lh]])).attr({ "stroke": "rgba(0,0,128)",'stroke-opacity':"0.7" });
    }
	
    for (var f = 0; f <= li[1]; f++) {//横线
        setting.push(paper.path([["M", (l[0] + lw / li[1] *f), (l[1]+yy*t - lh /li[1]  * f + lh)], ["L", (l[0] + width - lw / li[1] * f), (l[1]+yy*t - lh /li[1]  * f + lh)]])).attr({ "stroke": "rgba(0,0,128)" });
    }
	
	for (var jj = 0; jj < li[0]; jj++) {//列循环
    	for (var jjj = 0; jjj < li[1]; jjj++) {//行循环
			//if(data[jjj][jj][0] );
			if (data[jjj][jj][0] > -50 && data[jjj][jj][0] < 50) {
				var _xx = 70+ lw / li[0] * (li[1] - jjj) + (width - lw / (li[1]) * (li[1] - jjj) * 2) / (li[0] + 1) * jj +2.6* jj ; //数据坐标x轴
				var _yy =  index * yy + lh /  14 * jjj+6; //数据坐标y轴
				setting.push(paper.text(_xx, _yy , data[jjj][jj][0]).attr({ "stroke": "#000", "font": "11px 宋体, Arial" })); //绘制数据
			}
			else if (data[jjj][jj][0] != 1001) {//如果不是正常范围的值，且也不是1001，则显示异常
				 _xx = 70+ lw / li[0] * (li[1] - jjj) + (width - lw / (li[1]) * (li[1] - jjj) * 2) / (li[0] + 1) * jj+2.6* jj  ;  //数据坐标x轴
				 _yy =  index * yy + lh /  14 * jjj+6; //数据坐标y轴
				setting.push(paper.text(_xx, _yy, '异常').attr({ "stroke": "#FF0000 ", 'fill':'#FF0000',"font": "11px 宋体, Arial" })); //绘制数据
			}//如果温度值==1001，则说明该点没有布测温点，什么都不绘制
		}
	} 
	opts.setting = setting;
}

/**
*	@author wkm
*	@description 绘制左侧显示的文字，及点击文字后的事件
*	@params {
				paper:画板,
				layerSize:层的数量
			}
*
*/
function layerClick(paper,layerSize,opts){
	var yIncrement = 40;
	for (var i = 0; i < layerSize; i++) { 
		var result = null;
        paper.text(20, 180 + yIncrement* (i + 1), "第" + (i + 1) + "层").attr({ "stroke": "#000", "font": "12px 宋体, Arial" ,"cursor":"pointer"})
            .click(function (e) {
                var index= e.target.textContent.substring(1, 2);
				//这里可以使用ajax回调，然后把数据赋给第二个 
				result =  dataArray[index-1];
				//$.ajax({
//					   url:'',
//					   dataType:'json',
//					   type:'post',
//					   success:function(d){
//						   result = d || dataArray[0]
//						   },
//						error:function(d){
//							
//							}   
//					   })
				drawDynamic(paper,result,index,opts);
        	});
    } 
}

//var typeCode = '1';
//var baseData = {'仓库': '2号仓', '仓内温度': '0℃', '仓外温度': '0℃', '仓内湿度': '0.00%', '仓外湿度': '0.00%'};
//var paper;
//function draw(t) {
//    //document.getElementById('drawContent').innerHTML = ' ';
//    if (dataArray.length <= 0) return;
//    var li = [dataArray[0][0].length, dataArray[0].length+7]; //列数，行数
//    console.log(li[0]);
//    var n = dataArray.length; //层数-------------------------6层 ----console.log(n);
//    var width =46 * li[0]; //平行四边形的宽度=736px  -----------------每个小格子宽度为16px-----console.log(width);
//    if (width < 600) width = 600;
//    var height = n * 40;//300px   //6层的总高度---------console.log(height); 正背景矩形的高
//    //var wn = 1;//暂时不用，暂定为初始化显示层数
//    var l = [40, 0]; //距离边距，[左,上]  绘图的坐标起始点
//    var q =70; //角度
//    var lh = height / n+140; //景深
//    console.log(lh);//190
//    var lw = lh / (Math.tan(q * 2 * Math.PI / 360)); //景宽
//    console.log(lw);//69.15434451057847
//    var mw = width - 2*lw; //内宽度
//    console.log(mw);//551.691310978843 正背景矩形的宽
//    Raphael.el.DataArray = function(ec) {
//        this.dataArray = ec;
//        return this;
//    };
//    paper = Raphael("drawContent", 800, 500);//画板
//    var stSeting = paper.set(); //绘制背景
//    stSeting.push(
//        paper.rect(l[0] + lw, l[1], mw, height), //正背景
//        paper.path("M" +(l[0] + lw) + " " + l[1] + "L" + l[0]+ " " + (l[1] + lh) + "V" + (l[1] + lh + height) + "L" + (l[0] + lw) + " " + (l[1] + height) + ""), //左背景
//        paper.path("M" + (l[0] + lw + mw) + " " + l[1] + "L" + (l[0] + width) + " " + (l[1] + lh) + "V" + (l[1] + lh + height) + "L" + (l[0] + lw + mw) + " " + (l[1] + height) + ""),//右背景
//        paper.path('M'+(l[0] + lw)+' '+height+' L'+(l[0]+lw+mw)+" "+height+'L'+(l[0] + width )+' '+(height+lh)+'L'+l[0]+' '+(lh+height)+' '+'L'+(l[0] + lw)+' '+height));//底背景
//    stSeting.attr({ "fill": "90-#fff-#000", "fill-opacity": "0.1" });//背景属性,填充渐变，0.1透明
//    var stWall = paper.set(); //绘制墙
//    var _x = l[0] + lw;//x轴坐标  105.51464216791643
//    console.log(_x);
//    var _y = l[1]; //y轴的起始坐标点
//    console.log(_y);
//    var yy=40;//y轴的增量
//    console.log(yy);
//    var seLine = paper.set();//绘制线
//    for (var c = 0; c < li[0]+1; c++) {//竖线 l[0]=40px 1w=69.15434451057847  li[0]=16px;内宽度mw=597.691310978843 lh=190px
//        console.log(c);
//        seLine.push(paper.path([["M", (l[0] + lw + mw / (li[0]) * c), (l[1] +yy+lh * t + 5 * t)], ["L", (l[0] + width / (li[0]) * c), yy+(l[1]  + lh * (t + 1)+ 5 *t)]]));
//    }
//    for (var f = 0; f < li[1] + 1; f++) {//横线
//        //debugger;
//        seLine.push(paper.path([["M", (l[0] + lw / li[1] *f), (l[1] + lh - lh /li[1]  * f + lh * t + 5 *t+yy)], ["L", (l[0] + width - lw / li[1] * f), (l[1] + lh - lh / li[1] * f + lh * t + 5 * t+yy)]]));
//    }
//    seLine.attr({ "stroke": "rgba(0,0,128)" });
//    function drawwall(t){
//        stWall.push(paper.path([["M", _x, _y+yy*t], ["L", (_x + mw),_y+yy*t], ["L", l[0] + width, _y+yy*t + lh], ["L", l[0], _y+yy*t + lh], ["L", _x, _y+yy*t]]));//绘制平行四边形墙
//        stWall.attr({ "fill": "#F7E39A", "fill-opacity": "0.3", "cursor": "pointer" }).mouseout(function(event) {//墙的属性
//            this.animate({ "fill-opacity": "0.3" }, 1000);  //鼠标移出事件
//        }).mouseover(function(event) {
//            this.animate({ "fill-opacity": "1" }, 1000); //鼠标移入事件
//        });
//    }
//
//
//    for (var i = 0; i < n; i++) {
//        paper.text(20, _y+lh+40*(i+1), "第" + (i+1) + "层").attr({ "stroke": "#000", "font": "12px 宋体, Arial" ,"cursor":"pointer"})
//            .click(function (e) {
//                var t= e.target.textContent.substring(1, 2);
//                console.log(t);
//                stWall.remove();
//                //seLine.remove();
//                drawwall(t);
//            });
//    } 
//}

